﻿<div class="@(!User.Identity.IsAuthenticated ? "hidden" : "")" id="loggedInView">
    <div class="nav-collapse">
        @using (Html.BeginForm("LogOff", "Account", FormMethod.Post, new { id = "logoutForm" }))
        {
            @Html.AntiForgeryToken()
            <ul>
                <li class="nav">Du er logget inn som <a href="#">@User.Identity.Name</a></li>
                <li class="nav"><a href="javascript:document.getElementById('logoutForm').submit()">Logg ut</a></li>
            </ul>
        }
    </div>
</div>
<div class="@(User.Identity.IsAuthenticated ? "hidden" : "")" id="logInView">
    <nav class="btn-group hide-login">
        <ul>
            <li>
                <div class="button">
                    <a id="login-trigger" href="#" data-toggle="dropdown" class="dropdown-toggle">Logg inn</a>
                </div>
                <div id="login-content" class="dropdown-menu">
                    @using (Ajax.BeginForm("LoggIn", "Account", "Account", new AjaxOptions { HttpMethod = "post", OnSuccess = "OnLogon" }, new { @id = "loginform" }))
                    {
                        <div class="control-group">
                            <label class="control-label" for="UserName">Brukernavn</label>
                            <div class="controls">
                                <input id="UserName" name="UserName" type="text" placeholder="Brukernavn">
                            </div>
                        </div>
                        <div class="control-group">
                            <label class="control-label" for="Password">Passord</label>
                            <div class="controls">
                                <input id="Password" name="Password" type="password" placeholder="Passord">
                            </div>
                        </div>	
                        <div class="control-group">
                            <div class="controls">
                                <label>
                                    <input id="RembemberMe" name="RememberMe" type="checkbox" value="true" checked="checked" />&nbsp;Husk meg</label>
                            </div>
                        </div>		 		
                        <ul>
                            <li class="pull-left">
                                <label>Glemt passord</label></li>
                            <li>
                                <label>&nbsp;&nbsp;&nbsp;&nbsp;</label></li>
                            <li class="pull-right">
                                <div class="button">
                                    <a href="#" onclick="SubmitLogin()">Logg inn</a>
                                </div>
                            </li>
                        </ul>			 
                    }
                </div>
            </li>
        </ul>
    </nav>
    <nav class="btn-group hide-login">
        <ul>
            <li>
                <div class="button">
                    @Html.ActionLink("Registrering", "Register", "Account", null, new { id = "registerLink" })
                </div>
            </li>
        </ul>
    </nav>
</div>
